import re

class HTMLCleaner():

    @staticmethod
    def clean(dom):
        [s.extract() for s in dom.findAll('script')]
        [s.extract() for s in dom.findAll('style')]
        return dom

    @staticmethod
    def rm_tags(html):
        re.sub(r'\<\s*br\s*\/?\s*\>','\n',html)
        regex = re.compile(r'(?is)<.*?>')
        text = regex.sub('<tag>', html)
        return text